<?php

namespace JLPay\Models\Openmerch\Register;

use JLPay\Models\BaseRequest;

/**
 * 进件取消请求
 */
class IncomingCancelRequest extends BaseRequest
{
    /**
     * API URL
     */
    public const API_URL = '/open/merch/access/incoming/cancel';

    protected ?string $applyId = null;

    /**
     * 设置申请单号
     *
     * @param string $applyId
     * @return self
     */
    public function setApplyId(string $applyId): self
    {
        $this->applyId = $applyId;
        return $this;
    }

    /**
     * 获取申请单号
     *
     * @return string|null
     */
    public function getApplyId(): ?string
    {
        return $this->applyId;
    }

    /**
     * 转换为数组
     *
     * @return array
     */
    public function toArray(): array
    {
        $data = parent::toArray();
        if ($this->applyId) {
            $data['apply_id'] = $this->applyId;
        }
        return $data;
    }
} 